package com.riteny.paymentgateway.swifypass.sdk;

import com.riteny.paymentgateway.swifypass.config.SwiftPassPaymentGatewaySetting;
import com.riteny.paymentgateway.swifypass.datasource.MchProfileDatasource;
import com.riteny.paymentgateway.swifypass.entity.SwiftPassQueryPaymentOrderResponseEntity;
import com.riteny.paymentgateway.swifypass.entity.SwiftPassSubmitPaymentOrderResponseEntity;

/**
 * @author Riteny
 * 2022/1/6  16:24
 */
public class SwiftPassPaymentGatewaySdkService extends AbstractSwiftPassPaymentGatewaySdkService {

    private MchProfileDatasource mchProfileDatasource;

    public SwiftPassPaymentGatewaySdkService(MchProfileDatasource mchProfileDatasource) {

        super();

        this.mchProfileDatasource = mchProfileDatasource;
    }

    public SwiftPassSubmitPaymentOrderResponseEntity submitUnityOrder(Integer paymentGatewayType, String orderUuid
            , String deviceId, Integer totalFee, String body, String nonceStr) {

        SwiftPassPaymentGatewaySetting setting = mchProfileDatasource.getPaymentGatewayProfile();

        return super.submitUnityOrder(paymentGatewayType, setting, orderUuid, deviceId, totalFee, body, nonceStr);
    }

    public SwiftPassQueryPaymentOrderResponseEntity queryUnityOrder(Integer paymentGatewayType, String orderNo) {

        SwiftPassPaymentGatewaySetting setting = mchProfileDatasource.getPaymentGatewayProfile();

        return super.queryUnityOrder(paymentGatewayType, setting, orderNo);
    }
}
